using UnityEngine;

[System.Serializable]//可以使用此属性在检视面板中显示变量
public struct FloatRange
{
    [SerializeField]
    float min, max;

    public float Min => min;

    public float Max => max;

    public float RandomValueInRange
    {
        get{
            return Random.Range(min, max);
        }
    }

    public FloatRange(float value){
        min = max = value;
    }

    public FloatRange(float min, float max){
        this.min = min;
        this.max = max < min ? min : max;
    }
}